﻿using System;

namespace SpriteSheetsFabric.Wpf
{
    public partial class Baker
    {
        public class BakeHandler
        {
            private Action callBack = null;

            /// <summary>
            /// Considers the action that should be executed when bak operations have been completed.
            /// </summary>
            /// <param name="callBack">The call back.</param>
            public void AndThen(Action callBack)
            {
                this.callBack = callBack;
            }

            /// <summary>
            /// Invokes the bake operation.
            /// </summary>
            internal void Invoke()
            {
                if(callBack != null)
                {
                    this.callBack();
                }
            }
        }
    }
}
